package GUI;

import java.io.IOException;
import javax.swing.JOptionPane;

/**
 *@(#)VentanaColor.java
 * Creado 18/03/2010, 11:05:13 AM
 *
 * @author fires
 * @version 1.00
 * @since 1.6
 */
/**
 * Clase VentanaAyuda donde se despliega la ayuda del programa.
 * @since 1.6
 */
public class VentanaAyuda extends javax.swing.JDialog {
    ////////////////////////////////////////////////////////////////////////////
    // Constructores
    ////////////////////////////////////////////////////////////////////////////
    /**
     * Construye una Ventana de Ayuda.
     * @since 1.6
     */
    public VentanaAyuda(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        setLocationRelativeTo(parent);
       // mostrarAyuda();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Índice");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 734, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 406, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Donde despliega la ayuda del programa.
     *
     * @since 1.6
     */
    public void mostrarAyuda(){
        try {
            String path = new String("Ayuda.chm");
            Process pro = Runtime.getRuntime().exec( "hh.exe " + path); // para windows 7
        }catch (IOException ex){
            JOptionPane.showMessageDialog(null, "No se puede Mostrar la Ayuda",
                "Error!", JOptionPane.WARNING_MESSAGE);
        }
    }
    
   /**
    * Donde se ejecuta la Ventana Ayuda.
    *
    * @param args La linea de argumentos del comando
    * @since 1.6
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                VentanaAyuda dialog = new VentanaAyuda(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}